home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / MacApp / MacApp 3.0a2 / CPlusIncludes / Palettes.h < prev    next >
Text File  |  1991-05-01  |  5KB  |  146 lines

  1. /************************************************************
  2.  
  3. Created: Tuesday, January 8, 1991 at 9:43 AM
  4.     Palettes.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.    1987-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __PALETTES__
  15. #define __PALETTES__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21. #ifndef __WINDOWS__
  22. #include <Windows.h>
  23. #endif
  24.  
  25.  
  26. enum {
  27.  
  28.     pmCourteous = 0,        /*Record use of color on each device touched.*/
  29.     pmTolerant = 0x0002,    /*render ciRGB if ciTolerance is exceeded by best match.*/
  30.     pmAnimated = 0x0004,    /*reserve an index on each device touched and render ciRGB.*/
  31.     pmExplicit = 0x0008,    /*no reserve, no render, no record; stuff index into port.*/
  32.  
  33.     pmWhite = 0x0010,
  34.     pmBlack = 0x0020,
  35.  
  36.     pmInhibitG2 = 0x0100,
  37.     pmInhibitC2 = 0x0200,
  38.     pmInhibitG4 = 0x0400,
  39.     pmInhibitC4 = 0x0800,
  40.     pmInhibitG8 = 0x1000,
  41.     pmInhibitC8 = 0x2000,
  42.  
  43.  
  44. /* NSetPalette Update Constants */
  45.     pmNoUpdates = 0x8000,   /*no updates*/
  46.     pmBkUpdates = 0xA000,   /*background updates only*/
  47.     pmFgUpdates = 0xC000,   /*foreground updates only*/
  48.     pmAllUpdates = 0xE000   /*all updates*/
  49. };
  50.  
  51. struct ColorInfo {
  52.     RGBColor ciRGB;         /*true RGB values*/
  53.     short ciUsage;          /*color usage*/
  54.     short ciTolerance;      /*tolerance value*/
  55.     short ciDataFields[3];  /*private fields*/
  56. };
  57.  
  58. struct Palette {
  59.     short pmEntries;        /*entries in pmTable*/
  60.     short pmDataFields[7];  /*private fields*/
  61.     ColorInfo pmInfo[1];
  62. };
  63.  
  64. typedef struct Palette Palette;
  65. typedef Palette *PalettePtr, **PaletteHandle;
  66.  
  67.  
  68. #ifdef __cplusplus
  69. extern "C" {
  70. #endif
  71. pascal void InitPalettes(void)
  72.     = 0xAA90; 
  73. pascal PaletteHandle NewPalette(short entries,CTabHandle srcColors,short srcUsage,
  74.     short srcTolerance)
  75.     = 0xAA91; 
  76. pascal PaletteHandle GetNewPalette(short PaletteID)
  77.     = 0xAA92; 
  78. pascal void DisposePalette(PaletteHandle srcPalette)
  79.     = 0xAA93; 
  80. pascal void ActivatePalette(WindowPtr srcWindow)
  81.     = 0xAA94; 
  82. pascal void SetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,Boolean cUpdates)
  83.     = 0xAA95; 
  84. pascal void NSetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,short nCUpdates)
  85.     = 0xAA95; 
  86. pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  87.     = 0xAA96; 
  88. pascal void CopyPalette(PaletteHandle srcPalette,PaletteHandle dstPalette,
  89.     short srcEntry,short dstEntry,short dstLength)
  90.     = 0xAAA1; 
  91. pascal void PmForeColor(short dstEntry)
  92.     = 0xAA97; 
  93. pascal void PmBackColor(short dstEntry)
  94.     = 0xAA98; 
  95. pascal void AnimateEntry(WindowPtr dstWindow,short dstEntry,const RGBColor& srcRGB)
  96.     = 0xAA99; 
  97. pascal void AnimatePalette(WindowPtr dstWindow,CTabHandle srcCTab,short srcIndex,
  98.     short dstEntry,short dstLength)
  99.     = 0xAA9A; 
  100. pascal void GetEntryColor(PaletteHandle srcPalette,short srcEntry,RGBColor& dstRGB)
  101.     = 0xAA9B; 
  102. pascal void SetEntryColor(PaletteHandle dstPalette,short dstEntry,const RGBColor& srcRGB)
  103.     = 0xAA9C; 
  104. pascal void GetEntryUsage(PaletteHandle srcPalette,short srcEntry,short& dstUsage,
  105.     short& dstTolerance)
  106.     = 0xAA9D; 
  107. pascal void SetEntryUsage(PaletteHandle dstPalette,short dstEntry,short srcUsage,
  108.     short srcTolerance)
  109.     = 0xAA9E; 
  110. pascal void CTab2Palette(CTabHandle srcCTab,PaletteHandle dstPalette,short srcUsage,
  111.     short srcTolerance)
  112.     = 0xAA9F; 
  113. pascal void Palette2CTab(PaletteHandle srcPalette,CTabHandle dstCTab)
  114.     = 0xAAA0; 
  115. pascal long Entry2Index(short entry)
  116.     = {0x7000,0xAAA2}; 
  117. pascal void RestoreDeviceClut(GDHandle gd)
  118.     = {0x7002,0xAAA2}; 
  119. pascal void ResizePalette(PaletteHandle p,short size)
  120.     = {0x7003,0xAAA2}; 
  121. pascal void SaveFore(ColorSpec& c)
  122.     = {0x303C,0x040D,0xAAA2}; 
  123. pascal void SaveBack(ColorSpec& c)
  124.     = {0x303C,0x040E,0xAAA2}; 
  125. pascal void RestoreFore(const ColorSpec& c)
  126.     = {0x303C,0x040F,0xAAA2}; 
  127. pascal void RestoreBack(const ColorSpec& c)
  128.     = {0x303C,0x0410,0xAAA2}; 
  129. pascal OSErr SetDepth(GDHandle gd,short depth,short whichFlags,short flags)
  130.     = {0x303C,0x0A13,0xAAA2}; 
  131. pascal short HasDepth(GDHandle gd,short depth,short whichFlags,short flags)
  132.     = {0x303C,0x0A14,0xAAA2}; 
  133. pascal short PMgrVersion(void)
  134.     = {0x7015,0xAAA2}; 
  135. pascal void SetPaletteUpdates(PaletteHandle p,short updates)
  136.     = {0x303C,0x0616,0xAAA2}; 
  137. pascal short GetPaletteUpdates(PaletteHandle p)
  138.     = {0x303C,0x0417,0xAAA2}; 
  139. pascal Boolean GetGray(GDHandle device,const RGBColor& backGround,RGBColor& foreGround)
  140.     = {0x303C,0x1219,0xAAA2}; 
  141. #ifdef __cplusplus
  142. }
  143. #endif
  144.  
  145. #endif
  146.